home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / AIncludes / MacWindows.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  58.4 KB  |  1,727 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        MacWindows.a
  3. ;
  4. ;    Contains:    Window Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8.5
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1997-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__MACWINDOWS__') = 'UNDEFINED' THEN
  18. __MACWINDOWS__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.     IF &TYPE('__ALIASES__') = 'UNDEFINED' THEN
  24.     include 'Aliases.a'
  25.     ENDIF
  26.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  27.     include 'AppleEvents.a'
  28.     ENDIF
  29.     IF &TYPE('__COLLECTIONS__') = 'UNDEFINED' THEN
  30.     include 'Collections.a'
  31.     ENDIF
  32.     IF &TYPE('__DRAG__') = 'UNDEFINED' THEN
  33.     include 'Drag.a'
  34.     ENDIF
  35.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  36.     include 'Events.a'
  37.     ENDIF
  38.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  39.     include 'Menus.a'
  40.     ENDIF
  41.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  42.     include 'MixedMode.a'
  43.     ENDIF
  44.     IF &TYPE('__QDOFFSCREEN__') = 'UNDEFINED' THEN
  45.     include 'QDOffscreen.a'
  46.     ENDIF
  47.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  48.     include 'Quickdraw.a'
  49.     ENDIF
  50.     IF &TYPE('__TEXTCOMMON__') = 'UNDEFINED' THEN
  51.     include 'TextCommon.a'
  52.     ENDIF
  53.     IF &TYPE('__ICONS__') = 'UNDEFINED' THEN
  54.     include 'Icons.a'
  55.     ENDIF
  56.  
  57.  
  58. ; ——————————————————————————————————————————————————————————————————————————————————————
  59. ;  • Property Types (Mac OS 8.5 and later)                                                
  60. ; ——————————————————————————————————————————————————————————————————————————————————————
  61. ; typedef OSType                         PropertyCreator
  62.  
  63. ; typedef OSType                         PropertyTag
  64.  
  65. ; ——————————————————————————————————————————————————————————————————————————————————————
  66. ;  • Window Classes (Mac OS 8.5 and later)                                                
  67. ; ——————————————————————————————————————————————————————————————————————————————————————
  68. ; typedef UInt32                         WindowClass
  69.  
  70.  
  71. kAlertWindowClass                EQU        1                    ; “I need your attention now.”
  72. kMovableAlertWindowClass        EQU        2                    ; “I need your attention now, but I’m kind enough to let you switch out of this app to do other things.”
  73. kModalWindowClass                EQU        3                    ; system modal, not draggable
  74. kMovableModalWindowClass        EQU        4                    ; application modal, draggable
  75. kFloatingWindowClass            EQU        5                    ; floats above all other application windows
  76. kDocumentWindowClass            EQU        6                    ; everything else
  77.  
  78. ; ——————————————————————————————————————————————————————————————————————————————————————
  79. ;  • Window Attributes (Mac OS 8.5 and later)                                            
  80. ; ——————————————————————————————————————————————————————————————————————————————————————
  81.  
  82. ; typedef UInt32                         WindowAttributes
  83.  
  84.  
  85. kWindowNoAttributes                EQU        0                    ; no attributes
  86. kWindowCloseBoxAttribute        EQU        $00000001            ; window has a close box
  87. kWindowHorizontalZoomAttribute    EQU        $00000002            ; window has horizontal zoom box
  88. kWindowVerticalZoomAttribute    EQU        $00000004            ; window has vertical zoom box
  89. kWindowFullZoomAttribute        EQU        $00000006
  90. kWindowCollapseBoxAttribute        EQU        $00000008            ; window has a collapse box
  91. kWindowResizableAttribute        EQU        $00000010            ; window is resizable
  92. kWindowSideTitlebarAttribute    EQU        $00000020            ; window wants a titlebar on the side    (floating window class only)
  93. kWindowNoUpdatesAttribute        EQU        $00010000            ; this window receives no update events
  94. kWindowNoActivatesAttribute        EQU        $00020000            ; this window receives no activate events
  95. kWindowStandardDocumentAttributes EQU    $0000001F
  96. kWindowStandardFloatingAttributes EQU    $00000009
  97.  
  98. ; ——————————————————————————————————————————————————————————————————————————————————————
  99. ;  • Errors & Gestalt (Mac OS 8.5 and later)                                            
  100. ; ——————————————————————————————————————————————————————————————————————————————————————
  101.  
  102. gestaltWindowMgrAttr            EQU        'wind'                ; If this Gestalt exists, the Mac OS 8.5 Window Manager is installed
  103. gestaltWindowMgrPresent            EQU        $00000001
  104.  
  105.  
  106. errInvalidWindowPtr                EQU        -5600                ; tried to pass a bad WindowPtr argument
  107. errUnsupportedWindowAttributesForClass EQU -5601            ; tried to create a window with WindowAttributes not supported by the WindowClass
  108. errWindowDoesNotHaveProxy        EQU        -5602                ; tried to do something requiring a proxy to a window which doesn’t have a proxy
  109. errInvalidWindowProperty        EQU        -5603                ; tried to access a property tag with private creator
  110. errWindowPropertyNotFound        EQU        -5604                ; tried to get a nonexistent property
  111. errUnrecognizedWindowClass        EQU        -5605                ; tried to create a window with a bad WindowClass
  112. errCorruptWindowDescription        EQU        -5606                ; tried to load a corrupt window description (size or version fields incorrect)
  113. errUserWantsToDragWindow        EQU        -5607                ; if returned from TrackWindowProxyDrag, you should call DragWindow on the window
  114. errWindowsAlreadyInitialized    EQU        -5608                ; tried to call InitFloatingWindows twice, or called InitWindows and then floating windows
  115. errFloatingWindowsNotInitialized EQU    -5609                ; called HideFloatingWindows or ShowFloatingWindows without calling InitFloatingWindows
  116.  
  117.  
  118. ; ——————————————————————————————————————————————————————————————————————————————————————
  119. ;  • Window Definition Type                                                                
  120. ; ——————————————————————————————————————————————————————————————————————————————————————
  121.  
  122. kWindowDefProcType                EQU        'WDEF'
  123. ; ——————————————————————————————————————————————————————————————————————————————————————
  124. ;  • Mac OS 7.5 Window Definition Resource IDs                                            
  125. ; ——————————————————————————————————————————————————————————————————————————————————————
  126.  
  127. kStandardWindowDefinition        EQU        0                    ; for document windows and dialogs
  128. kRoundWindowDefinition            EQU        1                    ; old da-style window
  129. kFloatingWindowDefinition        EQU        124                    ; for floating windows
  130. ; ——————————————————————————————————————————————————————————————————————————————————————
  131. ;  • Variant Codes                                                                        
  132. ; ——————————————————————————————————————————————————————————————————————————————————————
  133.  
  134.                                                             ; for use with kStandardWindowDefinition 
  135. kDocumentWindowVariantCode        EQU        0
  136. kModalDialogVariantCode            EQU        1
  137. kPlainDialogVariantCode            EQU        2
  138. kShadowDialogVariantCode        EQU        3
  139. kMovableModalDialogVariantCode    EQU        5
  140. kAlertVariantCode                EQU        7
  141. kMovableAlertVariantCode        EQU        9                    ; for use with kFloatingWindowDefinition 
  142. kSideFloaterVariantCode            EQU        8
  143.  
  144. ; ——————————————————————————————————————————————————————————————————————————————————————
  145. ;  • DefProc IDs                                                                        
  146. ; ——————————————————————————————————————————————————————————————————————————————————————
  147.  
  148.                                                             ; classic ids 
  149. documentProc                    EQU        0
  150. dBoxProc                        EQU        1
  151. plainDBox                        EQU        2
  152. altDBoxProc                        EQU        3
  153. noGrowDocProc                    EQU        4
  154. movableDBoxProc                    EQU        5
  155. zoomDocProc                        EQU        8
  156. zoomNoGrow                        EQU        12
  157. rDocProc                        EQU        16                    ; floating window defproc ids 
  158. floatProc                        EQU        1985
  159. floatGrowProc                    EQU        1987
  160. floatZoomProc                    EQU        1989
  161. floatZoomGrowProc                EQU        1991
  162. floatSideProc                    EQU        1993
  163. floatSideGrowProc                EQU        1995
  164. floatSideZoomProc                EQU        1997
  165. floatSideZoomGrowProc            EQU        1999
  166.  
  167.                                                             ; Resource IDs for theme-savvy window defprocs 
  168. kWindowDocumentDefProcResID        EQU        64
  169. kWindowDialogDefProcResID        EQU        65
  170. kWindowUtilityDefProcResID        EQU        66
  171. kWindowUtilitySideTitleDefProcResID EQU    67
  172.  
  173.                                                             ; Proc IDs for theme-savvy windows 
  174. kWindowDocumentProc                EQU        1024
  175. kWindowGrowDocumentProc            EQU        1025
  176. kWindowVertZoomDocumentProc        EQU        1026
  177. kWindowVertZoomGrowDocumentProc    EQU        1027
  178. kWindowHorizZoomDocumentProc    EQU        1028
  179. kWindowHorizZoomGrowDocumentProc EQU    1029
  180. kWindowFullZoomDocumentProc        EQU        1030
  181. kWindowFullZoomGrowDocumentProc    EQU        1031
  182.  
  183.                                                             ; Proc IDs for theme-savvy dialogs 
  184. kWindowPlainDialogProc            EQU        1040
  185. kWindowShadowDialogProc            EQU        1041
  186. kWindowModalDialogProc            EQU        1042
  187. kWindowMovableModalDialogProc    EQU        1043
  188. kWindowAlertProc                EQU        1044
  189. kWindowMovableAlertProc            EQU        1045
  190.  
  191.                                                             ; procIDs available in Mac OS 8.1 (Appearance 1.0.1) or later 
  192. kWindowMovableModalGrowProc        EQU        1046
  193.  
  194.                                                             ; Proc IDs for top title bar theme-savvy floating windows 
  195. kWindowFloatProc                EQU        1057
  196. kWindowFloatGrowProc            EQU        1059
  197. kWindowFloatVertZoomProc        EQU        1061
  198. kWindowFloatVertZoomGrowProc    EQU        1063
  199. kWindowFloatHorizZoomProc        EQU        1065
  200. kWindowFloatHorizZoomGrowProc    EQU        1067
  201. kWindowFloatFullZoomProc        EQU        1069
  202. kWindowFloatFullZoomGrowProc    EQU        1071
  203.  
  204.  
  205.                                                             ; Proc IDs for side title bar theme-savvy floating windows 
  206. kWindowFloatSideProc            EQU        1073
  207. kWindowFloatSideGrowProc        EQU        1075
  208. kWindowFloatSideVertZoomProc    EQU        1077
  209. kWindowFloatSideVertZoomGrowProc EQU    1079
  210. kWindowFloatSideHorizZoomProc    EQU        1081
  211. kWindowFloatSideHorizZoomGrowProc EQU    1083
  212. kWindowFloatSideFullZoomProc    EQU        1085
  213. kWindowFloatSideFullZoomGrowProc EQU    1087
  214. ; ——————————————————————————————————————————————————————————————————————————————————————
  215. ;  • System 7 Window Positioning Constants                                                
  216. ;                                                                                         
  217. ;  Passed into StandardAlert and used in ‘WIND’, ‘DLOG’, and ‘ALRT’ templates            
  218. ;  StandardAlert uses zero to specify the default position. Other calls use zero to        
  219. ;  specify “no position”.  Do not pass these constants to RepositionWindow.  Do not        
  220. ;  store these constants in the BasicWindowDescription of a ‘wind’ resource.            
  221. ; ——————————————————————————————————————————————————————————————————————————————————————
  222.  
  223.  
  224. kWindowNoPosition                EQU        $0000
  225. kWindowDefaultPosition            EQU        $0000                ; used by StandardAlert
  226. kWindowCenterMainScreen            EQU        $280A
  227. kWindowAlertPositionMainScreen    EQU        $300A
  228. kWindowStaggerMainScreen        EQU        $380A
  229. kWindowCenterParentWindow        EQU        $A80A
  230. kWindowAlertPositionParentWindow EQU    $B00A
  231. kWindowStaggerParentWindow        EQU        $B80A
  232. kWindowCenterParentWindowScreen    EQU        $680A
  233. kWindowAlertPositionParentWindowScreen EQU $700A
  234. kWindowStaggerParentWindowScreen EQU    $780A
  235.  
  236. ; ——————————————————————————————————————————————————————————————————————————————————————
  237. ;  • Window Positioning Methods    (Mac OS 8.5 and later)                                    
  238. ;                                                                                         
  239. ;  Positioning methods passed to RepositionWindow.                                        
  240. ;  Do not use them in WIND, ALRT, DLOG templates.                                          
  241. ;  Do not confuse these constants with the constants above                                
  242. ; ——————————————————————————————————————————————————————————————————————————————————————
  243. ; typedef UInt32                         WindowPositionMethod
  244.  
  245.  
  246. kWindowCenterOnMainScreen        EQU        $00000001
  247. kWindowCenterOnParentWindow        EQU        $00000002
  248. kWindowCenterOnParentWindowScreen EQU    $00000003
  249. kWindowCascadeOnMainScreen        EQU        $00000004
  250. kWindowCascadeOnParentWindow    EQU        $00000005
  251. kWIndowCascadeOnParentWindowScreen EQU    $00000006
  252. kWindowAlertPositionOnMainScreen EQU    $00000007
  253. kWindowAlertPositionOnParentWindow EQU    $00000008
  254. kWindowAlertPositionOnParentWindowScreen EQU $00000009
  255.  
  256. ; ——————————————————————————————————————————————————————————————————————————————————————
  257. ;  • GetWindowRegion Types                                                                
  258. ; ——————————————————————————————————————————————————————————————————————————————————————
  259.  
  260.  
  261.                                                             ; Region values to pass into GetWindowRegion 
  262. kWindowTitleBarRgn                EQU        0
  263. kWindowTitleTextRgn                EQU        1
  264. kWindowCloseBoxRgn                EQU        2
  265. kWindowZoomBoxRgn                EQU        3
  266. kWindowDragRgn                    EQU        5
  267. kWindowGrowRgn                    EQU        6
  268. kWindowCollapseBoxRgn            EQU        7
  269. kWindowTitleProxyIconRgn        EQU        8                    ; Mac OS 8.5 and later
  270. kWindowStructureRgn                EQU        32
  271. kWindowContentRgn                EQU        33
  272.  
  273. ; typedef UInt16                         WindowRegionCode
  274.  
  275. ;  GetWindowRegionRec - a pointer to this is passed in WDEF param for kWindowMsgGetRegion
  276. GetWindowRegionRec        RECORD 0
  277. winRgn                     ds.l    1                ; offset: $0 (0)
  278. regionCode                 ds.w    1                ; offset: $4 (4)
  279. sizeof                     EQU *                    ; size:   $6 (6)
  280.                         ENDR
  281. ; typedef struct GetWindowRegionRec *    GetWindowRegionPtr
  282.  
  283. ; typedef struct GetWindowRegionRec *    GetWindowRegionRecPtr
  284.  
  285. ; ——————————————————————————————————————————————————————————————————————————————————————
  286. ;  • WDEF Message Types (Mac OS 8.5 and later)                                            
  287. ; ——————————————————————————————————————————————————————————————————————————————————————
  288.  
  289. ;   SetupWindowProxyDragImageRec - setup the proxy icon drag image
  290. ;   Both regions are allocated and disposed by the Window Manager.
  291. ;   The GWorld is disposed of by the Window Manager, but the WDEF must allocate
  292. ;   it.  See Technote on Drag Manager 1.1 additions for more information and sample code for
  293. ;   setting up drag images.
  294.  
  295.  
  296.  
  297. SetupWindowProxyDragImageRec RECORD 0
  298. imageGWorld                 ds.l    1                ; offset: $0 (0)        ;  locked GWorld containing the drag image - output - can be NULL
  299. imageRgn                 ds.l    1                ; offset: $4 (4)        ;  image clip region, contains the portion of the image which gets blitted to screen - preallocated output - if imageGWorld is NULL, this is ignored
  300. outlineRgn                 ds.l    1                ; offset: $8 (8)        ;  the outline region used on shallow monitors - preallocated output - must always be non-empty
  301. sizeof                     EQU *                    ; size:   $C (12)
  302.                         ENDR
  303. ;  MeasureWindowTitleRec - a pointer to this is passed in WDEF param for kWindowMsgGetRegion
  304. MeasureWindowTitleRec    RECORD 0
  305. ;  output parameters
  306. fullTitleWidth             ds.w    1                ; offset: $0 (0)        ;  text + proxy icon width
  307. titleTextWidth             ds.w    1                ; offset: $2 (2)        ;  text width
  308. ;  input parameters
  309. isUnicodeTitle             ds.b    1                ; offset: $4 (4)
  310. unused                     ds.b    1                ; offset: $5 (5)        ;  future use
  311. sizeof                     EQU *                    ; size:   $6 (6)
  312.                         ENDR
  313. ; typedef struct MeasureWindowTitleRec * MeasureWindowTitleRecPtr
  314.  
  315. ; ——————————————————————————————————————————————————————————————————————————————————————
  316. ;  • Standard Window Kinds                                                                
  317. ; ——————————————————————————————————————————————————————————————————————————————————————
  318.  
  319. dialogKind                        EQU        2
  320. userKind                        EQU        8
  321. kDialogWindowKind                EQU        2
  322. kApplicationWindowKind            EQU        8
  323.  
  324. ; ——————————————————————————————————————————————————————————————————————————————————————
  325. ;  • FindWindow Result Codes                                                            
  326. ; ——————————————————————————————————————————————————————————————————————————————————————
  327.  
  328. inDesk                            EQU        0
  329. inNoWindow                        EQU        0
  330. inMenuBar                        EQU        1
  331. inSysWindow                        EQU        2
  332. inContent                        EQU        3
  333. inDrag                            EQU        4
  334. inGrow                            EQU        5
  335. inGoAway                        EQU        6
  336. inZoomIn                        EQU        7
  337. inZoomOut                        EQU        8
  338. inCollapseBox                    EQU        11                    ; Mac OS 8.0 and later
  339. inProxyIcon                        EQU        12                    ; Mac OS 8.5 and later
  340.  
  341. ; ——————————————————————————————————————————————————————————————————————————————————————
  342. ;  • Window Definition Hit Test Result Codes                                            
  343. ; ——————————————————————————————————————————————————————————————————————————————————————
  344.  
  345. wNoHit                            EQU        0
  346. wInContent                        EQU        1
  347. wInDrag                            EQU        2
  348. wInGrow                            EQU        3
  349. wInGoAway                        EQU        4
  350. wInZoomIn                        EQU        5
  351. wInZoomOut                        EQU        6
  352. wInCollapseBox                    EQU        9                    ; Mac OS 8.0 and later
  353. wInProxyIcon                    EQU        10                    ; Mac OS 8.5 and later
  354.  
  355. ; ——————————————————————————————————————————————————————————————————————————————————————
  356. ;  • Window Definition Messages                                                            
  357. ; ——————————————————————————————————————————————————————————————————————————————————————
  358.  
  359.  
  360. kWindowMsgDraw                    EQU        0
  361. kWindowMsgHitTest                EQU        1
  362. kWindowMsgCalculateShape        EQU        2
  363. kWindowMsgInitialize            EQU        3
  364. kWindowMsgCleanUp                EQU        4
  365. kWindowMsgDrawGrowOutline        EQU        5
  366. kWindowMsgDrawGrowBox            EQU        6
  367. ;  Messages available in Mac OS 8.0 and later
  368.  
  369. kWindowMsgGetFeatures            EQU        7
  370. kWindowMsgGetRegion                EQU        8
  371. ;  Messages available in Mac OS 8.5 and later
  372.  
  373. kWindowMsgDragHilite            EQU        9                    ; parameter boolean indicating on or off
  374. kWindowMsgModified                EQU        10                    ; parameter boolean indicating saved (false) or modified (true)
  375. kWindowMsgDrawInCurrentPort        EQU        11                    ; same as kWindowMsgDraw, but must draw in current port
  376. kWindowMsgSetupProxyDragImage    EQU        12                    ; parameter pointer to SetupWindowProxyDragImageRec
  377. kWindowMsgStateChanged            EQU        13                    ; something about the window's state has changed
  378. kWindowMsgMeasureTitle            EQU        14                    ; measure and return the ideal title width
  379. ;  old names
  380.  
  381. wDraw                            EQU        0
  382. wHit                            EQU        1
  383. wCalcRgns                        EQU        2
  384. wNew                            EQU        3
  385. wDispose                        EQU        4
  386. wGrow                            EQU        5
  387. wDrawGIcon                        EQU        6
  388. ; ——————————————————————————————————————————————————————————————————————————————————————
  389. ;  • State-changed Flags for kWindowMsgStateChanged (Mac OS 8.5 and later)                
  390. ; ——————————————————————————————————————————————————————————————————————————————————————
  391.  
  392. kWindowStateTitleChanged        EQU        $01
  393. kWindowStateSizeChanged            EQU        $02
  394. kWindowStatePositionChanged        EQU        $04
  395. kWindowStateZOrderChanged        EQU        $08
  396. kWindowStateVisibilityChanged    EQU        $10
  397. kWindowStateHiliteChanged        EQU        $20
  398. kWindowStateCollapseChanged        EQU        $40
  399.  
  400. ; ——————————————————————————————————————————————————————————————————————————————————————
  401. ;  • Window Feature Bits                                                                
  402. ; ——————————————————————————————————————————————————————————————————————————————————————
  403.  
  404. kWindowCanGrow                    EQU        $01
  405. kWindowCanZoom                    EQU        $02
  406. kWindowCanCollapse                EQU        $04
  407. kWindowIsModal                    EQU        $08
  408. kWindowCanGetWindowRegion        EQU        $10
  409. kWindowIsAlert                    EQU        $20
  410. kWindowHasTitleBar                EQU        $40
  411. ;  Message bits available in Mac OS 8.5 and later
  412.  
  413. kWindowSupportsDragHilite        EQU        $80                    ; window definition supports kWindowMsgDragHilite
  414. kWindowSupportsModifiedBit        EQU        $0100                ; window definition supports kWindowMsgModified
  415. kWindowCanDrawInCurrentPort        EQU        $0200                ; window definition supports kWindowMsgDrawInCurrentPort
  416. kWindowCanSetupProxyDragImage    EQU        $0400                ; window definition supports kWindowMsgSetupProxyDragImage
  417. kWindowCanMeasureTitle            EQU        $0800                ; window definition supports kWindowMsgMeasureTitle
  418. kWindowWantsDisposeAtProcessDeath EQU    $1000                ; window definition wants a Dispose message for windows still extant during ExitToShell
  419.  
  420. ; ——————————————————————————————————————————————————————————————————————————————————————
  421. ;  • Desktop Pattern Resource ID                                                        
  422. ; ——————————————————————————————————————————————————————————————————————————————————————
  423.  
  424. deskPatID                        EQU        16
  425.  
  426.  
  427. ; ——————————————————————————————————————————————————————————————————————————————————————
  428. ;  • Window Color Part Codes                                                            
  429. ; ——————————————————————————————————————————————————————————————————————————————————————
  430.  
  431. wContentColor                    EQU        0
  432. wFrameColor                        EQU        1
  433. wTextColor                        EQU        2
  434. wHiliteColor                    EQU        3
  435. wTitleBarColor                    EQU        4
  436.  
  437. ; ——————————————————————————————————————————————————————————————————————————————————————
  438. ;     • Region Dragging Constants                                                            
  439. ; ——————————————————————————————————————————————————————————————————————————————————————
  440.  
  441.  
  442. kMouseUpOutOfSlop                EQU        $80008000
  443.  
  444. ; ——————————————————————————————————————————————————————————————————————————————————————
  445. ;  • Window Color Table                                                                    
  446. ; ——————————————————————————————————————————————————————————————————————————————————————
  447. WinCTab                    RECORD 0
  448. wCSeed                     ds.l    1                ; offset: $0 (0)        ;  reserved 
  449. wCReserved                 ds.w    1                ; offset: $4 (4)        ;  reserved 
  450. ctSize                     ds.w    1                ; offset: $6 (6)        ;  usually 4 for windows 
  451. ctTable                     ds.b    5 * ColorSpec.sizeof ; offset: $8 (8)
  452. sizeof                     EQU *                    ; size:   $30 (48)
  453.                         ENDR
  454. ; typedef struct WinCTab *                WCTabPtr
  455.  
  456. ; typedef WCTabPtr *                    WCTabHandle
  457.  
  458. ; ——————————————————————————————————————————————————————————————————————————————————————
  459. ;  • WindowRecord                                                                        
  460. ; ——————————————————————————————————————————————————————————————————————————————————————
  461.  
  462.  
  463. ; typedef WindowRecord *                WindowPeek
  464.  
  465. WindowRecord            RECORD 0
  466. port                     ds        GrafPort        ; offset: $0 (0)
  467. windowKind                 ds.w    1                ; offset: $6C (108)
  468. visible                     ds.b    1                ; offset: $6E (110)
  469. hilited                     ds.b    1                ; offset: $6F (111)
  470. goAwayFlag                 ds.b    1                ; offset: $70 (112)
  471. spareFlag                 ds.b    1                ; offset: $71 (113)
  472. strucRgn                 ds.l    1                ; offset: $72 (114)
  473. contRgn                     ds.l    1                ; offset: $76 (118)
  474. updateRgn                 ds.l    1                ; offset: $7A (122)
  475. windowDefProc             ds.l    1                ; offset: $7E (126)
  476. dataHandle                 ds.l    1                ; offset: $82 (130)
  477. titleHandle                 ds.l    1                ; offset: $86 (134)
  478. titleWidth                 ds.w    1                ; offset: $8A (138)
  479. controlList                 ds.l    1                ; offset: $8C (140)
  480. nextWindow                 ds.l    1                ; offset: $90 (144)
  481. windowPic                 ds.l    1                ; offset: $94 (148)
  482. refCon                     ds.l    1                ; offset: $98 (152)
  483. sizeof                     EQU *                    ; size:   $9C (156)
  484.                         ENDR
  485. ; ——————————————————————————————————————————————————————————————————————————————————————
  486. ;  • Color WindowRecord                                                                    
  487. ; ——————————————————————————————————————————————————————————————————————————————————————
  488.  
  489.  
  490. ; typedef CWindowRecord *                CWindowPeek
  491.  
  492. CWindowRecord            RECORD 0
  493. port                     ds        CGrafPort        ; offset: $0 (0)
  494. windowKind                 ds.w    1                ; offset: $6C (108)
  495. visible                     ds.b    1                ; offset: $6E (110)
  496. hilited                     ds.b    1                ; offset: $6F (111)
  497. goAwayFlag                 ds.b    1                ; offset: $70 (112)
  498. spareFlag                 ds.b    1                ; offset: $71 (113)
  499. strucRgn                 ds.l    1                ; offset: $72 (114)
  500. contRgn                     ds.l    1                ; offset: $76 (118)
  501. updateRgn                 ds.l    1                ; offset: $7A (122)
  502. windowDefProc             ds.l    1                ; offset: $7E (126)
  503. dataHandle                 ds.l    1                ; offset: $82 (130)
  504. titleHandle                 ds.l    1                ; offset: $86 (134)
  505. titleWidth                 ds.w    1                ; offset: $8A (138)
  506. controlList                 ds.l    1                ; offset: $8C (140)
  507. nextWindow                 ds.l    1                ; offset: $90 (144)
  508. windowPic                 ds.l    1                ; offset: $94 (148)
  509. refCon                     ds.l    1                ; offset: $98 (152)
  510. sizeof                     EQU *                    ; size:   $9C (156)
  511.                         ENDR
  512. ; ——————————————————————————————————————————————————————————————————————————————————————
  513. ;  • AuxWinHandle                                                                        
  514. ; ——————————————————————————————————————————————————————————————————————————————————————
  515.  
  516.  
  517. ; typedef AuxWinRec *                    AuxWinPtr
  518.  
  519. ; typedef AuxWinPtr *                    AuxWinHandle
  520.  
  521. AuxWinRec                RECORD 0
  522. awNext                     ds.l    1                ; offset: $0 (0)        ; handle to next AuxWinRec
  523. awOwner                     ds.l    1                ; offset: $4 (4)        ; ptr to window 
  524. awCTable                 ds.l    1                ; offset: $8 (8)        ; color table for this window
  525. reserved                 ds.l    1                ; offset: $C (12)
  526. awFlags                     ds.l    1                ; offset: $10 (16)        ; reserved for expansion
  527. awReserved                 ds.l    1                ; offset: $14 (20)        ; reserved for expansion
  528. awRefCon                 ds.l    1                ; offset: $18 (24)        ; user Constant
  529. sizeof                     EQU *                    ; size:   $1C (28)
  530.                         ENDR
  531. ; ——————————————————————————————————————————————————————————————————————————————————————
  532. ;     • BasicWindowDescription    (Mac OS 8.5 and later)                                    
  533. ;                                                                                         
  534. ;     Contains statically-sized basic attributes of the window, for storage in a            
  535. ;     collection item.                                                                    
  536. ; ——————————————————————————————————————————————————————————————————————————————————————
  537. ;  constants for the version field
  538.  
  539. kWindowDefinitionVersionOne        EQU        1
  540. kWindowDefinitionVersionTwo        EQU        2
  541. ;  constants for the stateflags bit field 
  542.  
  543. kWindowIsCollapsedState            EQU        $01
  544. BasicWindowDescription    RECORD 0
  545. descriptionSize             ds.l    1                ; offset: $0 (0)        ;  sizeof(BasicWindowDescription)
  546. windowContentRect         ds        Rect            ; offset: $4 (4)        ;  location on screen
  547. windowZoomRect             ds        Rect            ; offset: $C (12)        ;  location on screen when zoomed out
  548. windowRefCon             ds.l    1                ; offset: $14 (20)        ;  the refcon - __avoid saving stale pointers here__    
  549. windowStateFlags         ds.l    1                ; offset: $18 (24)        ;  flags indicating status of transient window state
  550. windowPositionMethod     ds.l    1                ; offset: $1C (28)        ;  method last used by RepositionWindow to position the window (if any)
  551. windowDefinitionVersion     ds.l    1                ; offset: $20 (32)
  552. windowDefProc             ds.w    1                ; offset: $24 (36)        ;  defProc and variant
  553. windowHasCloseBox         ds.b    1                ; offset: $26 (38)
  554.                          ORG 36
  555. windowClass                 ds.l    1                ; offset: $24 (36)        ;  the class
  556. windowAttributes         ds.l    1                ; offset: $28 (40)        ;  the attributes
  557. sizeof                     EQU *                    ; size:   $2C (44)
  558.                         ENDR
  559. ;   the window manager stores the default collection items using these IDs
  560.  
  561. kStoredWindowSystemTag            EQU        'appl'                ; Only Apple collection items will be of this tag
  562. kStoredBasicWindowDescriptionID    EQU        'sbas'                ; BasicWindowDescription
  563. kStoredWindowPascalTitleID        EQU        's255'                ; pascal title string
  564. ; ——————————————————————————————————————————————————————————————————————————————————————
  565. ;  • Window Class Ordering                                                                
  566. ;                                                                                         
  567. ;     Special cases for the “behind” parameter in window creation calls.                    
  568. ; ——————————————————————————————————————————————————————————————————————————————————————
  569.  
  570. kFirstWindowOfClass                EQU        -1
  571. kLastWindowOfClass                EQU        0
  572. ; ——————————————————————————————————————————————————————————————————————————————————————
  573. ;  • Zoom Information Handle                                                             
  574. ; ——————————————————————————————————————————————————————————————————————————————————————
  575. WStateData                RECORD 0
  576. userState                 ds        Rect            ; offset: $0 (0)        ; user zoom state
  577. stdState                 ds        Rect            ; offset: $8 (8)        ; standard zoom state
  578. sizeof                     EQU *                    ; size:   $10 (16)
  579.                         ENDR
  580. ; typedef struct WStateData *            WStateDataPtr
  581.  
  582. ; typedef WStateDataPtr *                WStateDataHandle
  583.  
  584. ; ——————————————————————————————————————————————————————————————————————————————————————
  585. ;  • Window Creation & Persistence                                                        
  586. ; ——————————————————————————————————————————————————————————————————————————————————————
  587. ;
  588. ; pascal WindowPtr GetNewCWindow(short windowID, void *wStorage, WindowPtr behind)
  589. ;
  590.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  591.         _GetNewCWindow:    OPWORD    $AA46
  592.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  593.         IMPORT_CFM_FUNCTION GetNewCWindow
  594.     ENDIF
  595.  
  596. ;
  597. ; pascal WindowPtr NewWindow(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short theProc, WindowPtr behind, Boolean goAwayFlag, long refCon)
  598. ;
  599.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  600.         _NewWindow:    OPWORD    $A913
  601.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  602.         IMPORT_CFM_FUNCTION NewWindow
  603.     ENDIF
  604.  
  605. ;
  606. ; pascal WindowPtr GetNewWindow(short windowID, void *wStorage, WindowPtr behind)
  607. ;
  608.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  609.         _GetNewWindow:    OPWORD    $A9BD
  610.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  611.         IMPORT_CFM_FUNCTION GetNewWindow
  612.     ENDIF
  613.  
  614. ;
  615. ; pascal WindowPtr NewCWindow(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon)
  616. ;
  617.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  618.         _NewCWindow:    OPWORD    $AA45
  619.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  620.         IMPORT_CFM_FUNCTION NewCWindow
  621.     ENDIF
  622.  
  623. ;
  624. ; pascal void DisposeWindow(WindowPtr window)
  625. ;
  626.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  627.         _DisposeWindow:    OPWORD    $A914
  628.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  629.         IMPORT_CFM_FUNCTION DisposeWindow
  630.     ENDIF
  631.  
  632. ;
  633. ; pascal void CloseWindow(WindowPtr window)
  634. ;
  635.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  636.         _CloseWindow:    OPWORD    $A92D
  637.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  638.         IMPORT_CFM_FUNCTION CloseWindow
  639.     ENDIF
  640.  
  641.  
  642. ;  Routines available in Mac OS 8.5 and later
  643.  
  644. ;
  645. ; pascal OSStatus CreateNewWindow(WindowClass windowClass, WindowAttributes attributes, const Rect *bounds, WindowPtr *outWindow)
  646. ;
  647.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  648.         IMPORT_CFM_FUNCTION CreateNewWindow
  649.     ENDIF
  650.  
  651. ;  Create a window from a ‘wind’ resource
  652. ;
  653. ; pascal OSStatus CreateWindowFromResource(SInt16 resID, WindowPtr *outWindow)
  654. ;
  655.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  656.         IMPORT_CFM_FUNCTION CreateWindowFromResource
  657.     ENDIF
  658.  
  659. ;  window persistence
  660. ;
  661. ; pascal OSStatus StoreWindowIntoCollection(WindowPtr window, Collection collection)
  662. ;
  663.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  664.         IMPORT_CFM_FUNCTION StoreWindowIntoCollection
  665.     ENDIF
  666.  
  667. ;
  668. ; pascal OSStatus CreateWindowFromCollection(Collection collection, WindowPtr *outWindow)
  669. ;
  670.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  671.         IMPORT_CFM_FUNCTION CreateWindowFromCollection
  672.     ENDIF
  673.  
  674. ;  window refcounting
  675. ;
  676. ; pascal OSStatus GetWindowOwnerCount(WindowPtr window, UInt32 *outCount)
  677. ;
  678.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  679.         IMPORT_CFM_FUNCTION GetWindowOwnerCount
  680.     ENDIF
  681.  
  682. ;
  683. ; pascal OSStatus CloneWindow(WindowPtr window)
  684. ;
  685.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  686.         IMPORT_CFM_FUNCTION CloneWindow
  687.     ENDIF
  688.  
  689.  
  690. ; ——————————————————————————————————————————————————————————————————————————————————————
  691. ;  • Window Class Accessors (Mac OS 8.5 and later)                                        
  692. ; ——————————————————————————————————————————————————————————————————————————————————————
  693. ;
  694. ; pascal OSStatus GetWindowClass(WindowPtr window, WindowClass *outClass)
  695. ;
  696.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  697.         IMPORT_CFM_FUNCTION GetWindowClass
  698.     ENDIF
  699.  
  700. ;
  701. ; pascal OSStatus GetWindowAttributes(WindowPtr window, WindowAttributes *outAttributes)
  702. ;
  703.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  704.         IMPORT_CFM_FUNCTION GetWindowAttributes
  705.     ENDIF
  706.  
  707.  
  708. ; ——————————————————————————————————————————————————————————————————————————————————————
  709. ;  • Floating Windows (Mac OS 8.5 and later)                                            
  710. ; ——————————————————————————————————————————————————————————————————————————————————————
  711. ;
  712. ; pascal OSStatus ShowFloatingWindows(void)
  713. ;
  714.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  715.         IMPORT_CFM_FUNCTION ShowFloatingWindows
  716.     ENDIF
  717.  
  718. ;
  719. ; pascal OSStatus HideFloatingWindows(void)
  720. ;
  721.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  722.         IMPORT_CFM_FUNCTION HideFloatingWindows
  723.     ENDIF
  724.  
  725. ;
  726. ; pascal Boolean AreFloatingWindowsVisible(void)
  727. ;
  728.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  729.         IMPORT_CFM_FUNCTION AreFloatingWindowsVisible
  730.     ENDIF
  731.  
  732. ;
  733. ; pascal WindowPtr FrontNonFloatingWindow(void)
  734. ;
  735.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  736.         IMPORT_CFM_FUNCTION FrontNonFloatingWindow
  737.     ENDIF
  738.  
  739.  
  740.  
  741. ; ——————————————————————————————————————————————————————————————————————————————————————
  742. ;  • Background Imaging                                                                    
  743. ; ——————————————————————————————————————————————————————————————————————————————————————
  744. ;
  745. ; pascal void SetWinColor(WindowPtr window, WCTabHandle newColorTable)
  746. ;
  747.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  748.         _SetWinColor:    OPWORD    $AA41
  749.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  750.         IMPORT_CFM_FUNCTION SetWinColor
  751.     ENDIF
  752.  
  753. ;
  754. ; pascal void SetDeskCPat(PixPatHandle deskPixPat)
  755. ;
  756.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  757.         _SetDeskCPat:    OPWORD    $AA47
  758.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  759.         IMPORT_CFM_FUNCTION SetDeskCPat
  760.     ENDIF
  761.  
  762. ;  Routines available in Mac OS 8.5 and later
  763.  
  764. ;
  765. ; pascal OSStatus SetWindowContentColor(WindowPtr window, RGBColor *color)
  766. ;
  767.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  768.         IMPORT_CFM_FUNCTION SetWindowContentColor
  769.     ENDIF
  770.  
  771. ;
  772. ; pascal OSStatus GetWindowContentColor(WindowPtr window, RGBColor *color)
  773. ;
  774.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  775.         IMPORT_CFM_FUNCTION GetWindowContentColor
  776.     ENDIF
  777.  
  778. ;
  779. ; pascal OSStatus GetWindowContentPattern(WindowPtr window, PixPatHandle outPixPat)
  780. ;
  781.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  782.         IMPORT_CFM_FUNCTION GetWindowContentPattern
  783.     ENDIF
  784.  
  785. ;
  786. ; pascal OSStatus SetWindowContentPattern(WindowPtr window, PixPatHandle pixPat)
  787. ;
  788.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  789.         IMPORT_CFM_FUNCTION SetWindowContentPattern
  790.     ENDIF
  791.  
  792.  
  793.  
  794. ; ——————————————————————————————————————————————————————————————————————————————————————
  795. ;  • Low-Level Region & Painting Routines                                                
  796. ; ——————————————————————————————————————————————————————————————————————————————————————
  797. ;
  798. ; pascal void ClipAbove(WindowPtr window)
  799. ;
  800.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  801.         _ClipAbove:    OPWORD    $A90B
  802.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  803.         IMPORT_CFM_FUNCTION ClipAbove
  804.     ENDIF
  805.  
  806. ;
  807. ; pascal void SaveOld(WindowPtr window)
  808. ;
  809.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  810.         _SaveOld:    OPWORD    $A90E
  811.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  812.         IMPORT_CFM_FUNCTION SaveOld
  813.     ENDIF
  814.  
  815. ;
  816. ; pascal void DrawNew(WindowPtr window, Boolean update)
  817. ;
  818.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  819.         _DrawNew:    OPWORD    $A90F
  820.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  821.         IMPORT_CFM_FUNCTION DrawNew
  822.     ENDIF
  823.  
  824. ;
  825. ; pascal void PaintOne(WindowPtr window, RgnHandle clobberedRgn)
  826. ;
  827.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  828.         _PaintOne:    OPWORD    $A90C
  829.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  830.         IMPORT_CFM_FUNCTION PaintOne
  831.     ENDIF
  832.  
  833. ;
  834. ; pascal void PaintBehind(WindowPtr startWindow, RgnHandle clobberedRgn)
  835. ;
  836.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  837.         _PaintBehind:    OPWORD    $A90D
  838.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  839.         IMPORT_CFM_FUNCTION PaintBehind
  840.     ENDIF
  841.  
  842. ;
  843. ; pascal void CalcVis(WindowPtr window)
  844. ;
  845.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  846.         _CalcVis:    OPWORD    $A909
  847.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  848.         IMPORT_CFM_FUNCTION CalcVis
  849.     ENDIF
  850.  
  851. ;
  852. ; pascal void CalcVisBehind(WindowPtr startWindow, RgnHandle clobberedRgn)
  853. ;
  854.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  855.         _CalcVisBehind:    OPWORD    $A90A
  856.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  857.         IMPORT_CFM_FUNCTION CalcVisBehind
  858.     ENDIF
  859.  
  860. ;
  861. ; pascal Boolean CheckUpdate(EventRecord *theEvent)
  862. ;
  863.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  864.         _CheckUpdate:    OPWORD    $A911
  865.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  866.         IMPORT_CFM_FUNCTION CheckUpdate
  867.     ENDIF
  868.  
  869.  
  870. ; ——————————————————————————————————————————————————————————————————————————————————————
  871. ;  • Window List                                                                        
  872. ; ——————————————————————————————————————————————————————————————————————————————————————
  873. ;
  874. ; pascal short FindWindow(Point thePoint, WindowPtr *window)
  875. ;
  876.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  877.         _FindWindow:    OPWORD    $A92C
  878.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  879.         IMPORT_CFM_FUNCTION FindWindow
  880.     ENDIF
  881.  
  882. ;
  883. ; pascal WindowPtr FrontWindow(void )
  884. ;
  885.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  886.         _FrontWindow:    OPWORD    $A924
  887.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  888.         IMPORT_CFM_FUNCTION FrontWindow
  889.     ENDIF
  890.  
  891. ;
  892. ; pascal void BringToFront(WindowPtr window)
  893. ;
  894.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  895.         _BringToFront:    OPWORD    $A920
  896.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  897.         IMPORT_CFM_FUNCTION BringToFront
  898.     ENDIF
  899.  
  900. ;
  901. ; pascal void SendBehind(WindowPtr window, WindowPtr behindWindow)
  902. ;
  903.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  904.         _SendBehind:    OPWORD    $A921
  905.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  906.         IMPORT_CFM_FUNCTION SendBehind
  907.     ENDIF
  908.  
  909. ;
  910. ; pascal void SelectWindow(WindowPtr window)
  911. ;
  912.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  913.         _SelectWindow:    OPWORD    $A91F
  914.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  915.         IMPORT_CFM_FUNCTION SelectWindow
  916.     ENDIF
  917.  
  918.  
  919. ; ——————————————————————————————————————————————————————————————————————————————————————
  920. ;  • Misc Low-Level stuff                                                                
  921. ; ——————————————————————————————————————————————————————————————————————————————————————
  922. ;
  923. ; pascal void InitWindows(void )
  924. ;
  925.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  926.         _InitWindows:    OPWORD    $A912
  927.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  928.         IMPORT_CFM_FUNCTION InitWindows
  929.     ENDIF
  930.  
  931. ;
  932. ; pascal void GetWMgrPort(GrafPtr *wPort)
  933. ;
  934.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  935.         _GetWMgrPort:    OPWORD    $A910
  936.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  937.         IMPORT_CFM_FUNCTION GetWMgrPort
  938.     ENDIF
  939.  
  940. ;
  941. ; pascal void GetCWMgrPort(CGrafPtr *wMgrCPort)
  942. ;
  943.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  944.         _GetCWMgrPort:    OPWORD    $AA48
  945.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  946.         IMPORT_CFM_FUNCTION GetCWMgrPort
  947.     ENDIF
  948.  
  949. ;  Routines available in Mac OS 8.5 and later
  950.  
  951. ;
  952. ; pascal Boolean IsValidWindowPtr(GrafPtr grafPort)
  953. ;
  954.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  955.         IMPORT_CFM_FUNCTION IsValidWindowPtr
  956.     ENDIF
  957.  
  958. ;
  959. ; pascal OSStatus InitFloatingWindows(void)
  960. ;
  961.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  962.         IMPORT_CFM_FUNCTION InitFloatingWindows
  963.     ENDIF
  964.  
  965.  
  966.  
  967. ; ——————————————————————————————————————————————————————————————————————————————————————
  968. ;  • Various & Sundry Window Accessors                                                    
  969. ; ——————————————————————————————————————————————————————————————————————————————————————
  970. ;
  971. ; pascal void HiliteWindow(WindowPtr window, Boolean fHilite)
  972. ;
  973.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  974.         _HiliteWindow:    OPWORD    $A91C
  975.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  976.         IMPORT_CFM_FUNCTION HiliteWindow
  977.     ENDIF
  978.  
  979. ;
  980. ; pascal void SetWRefCon(WindowPtr window, long data)
  981. ;
  982.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  983.         _SetWRefCon:    OPWORD    $A918
  984.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  985.         IMPORT_CFM_FUNCTION SetWRefCon
  986.     ENDIF
  987.  
  988. ;
  989. ; pascal long GetWRefCon(WindowPtr window)
  990. ;
  991.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  992.         _GetWRefCon:    OPWORD    $A917
  993.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  994.         IMPORT_CFM_FUNCTION GetWRefCon
  995.     ENDIF
  996.  
  997. ;
  998. ; pascal void SetWindowPic(WindowPtr window, PicHandle pic)
  999. ;
  1000.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1001.         _SetWindowPic:    OPWORD    $A92E
  1002.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1003.         IMPORT_CFM_FUNCTION SetWindowPic
  1004.     ENDIF
  1005.  
  1006. ;
  1007. ; pascal PicHandle GetWindowPic(WindowPtr window)
  1008. ;
  1009.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1010.         _GetWindowPic:    OPWORD    $A92F
  1011.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1012.         IMPORT_CFM_FUNCTION GetWindowPic
  1013.     ENDIF
  1014.  
  1015. ;
  1016. ; pascal short GetWVariant(WindowPtr window)
  1017. ;
  1018.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1019.         _GetWVariant:    OPWORD    $A80A
  1020.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1021.         IMPORT_CFM_FUNCTION GetWVariant
  1022.     ENDIF
  1023.  
  1024. ;  Routines available in Mac OS 8.0 (Appearance 1.0) and later
  1025. ;
  1026. ; pascal OSStatus GetWindowFeatures(WindowPtr window, UInt32 *outFeatures)
  1027. ;
  1028.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1029.         Macro
  1030.         _GetWindowFeatures
  1031.             move.w              #$0013,D0
  1032.             dc.w                $AA74
  1033.         EndM
  1034.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1035.         IMPORT_CFM_FUNCTION GetWindowFeatures
  1036.     ENDIF
  1037.  
  1038. ;
  1039. ; pascal OSStatus GetWindowRegion(WindowPtr window, WindowRegionCode inRegionCode, RgnHandle ioWinRgn)
  1040. ;
  1041.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1042.         Macro
  1043.         _GetWindowRegion
  1044.             move.w              #$0014,D0
  1045.             dc.w                $AA74
  1046.         EndM
  1047.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1048.         IMPORT_CFM_FUNCTION GetWindowRegion
  1049.     ENDIF
  1050.  
  1051.  
  1052.  
  1053. ; ——————————————————————————————————————————————————————————————————————————————————————
  1054. ;  • Update Events                                                                        
  1055. ; ——————————————————————————————————————————————————————————————————————————————————————
  1056.  
  1057. ;
  1058. ; pascal void InvalRect(const Rect *badRect)
  1059. ;
  1060.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1061.         _InvalRect:    OPWORD    $A928
  1062.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1063.         IMPORT_CFM_FUNCTION InvalRect
  1064.     ENDIF
  1065.  
  1066. ;
  1067. ; pascal void InvalRgn(RgnHandle badRgn)
  1068. ;
  1069.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1070.         _InvalRgn:    OPWORD    $A927
  1071.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1072.         IMPORT_CFM_FUNCTION InvalRgn
  1073.     ENDIF
  1074.  
  1075. ;
  1076. ; pascal void ValidRect(const Rect *goodRect)
  1077. ;
  1078.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1079.         _ValidRect:    OPWORD    $A92A
  1080.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1081.         IMPORT_CFM_FUNCTION ValidRect
  1082.     ENDIF
  1083.  
  1084. ;
  1085. ; pascal void ValidRgn(RgnHandle goodRgn)
  1086. ;
  1087.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1088.         _ValidRgn:    OPWORD    $A929
  1089.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1090.         IMPORT_CFM_FUNCTION ValidRgn
  1091.     ENDIF
  1092.  
  1093. ;
  1094. ; pascal void BeginUpdate(WindowPtr window)
  1095. ;
  1096.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1097.         _BeginUpdate:    OPWORD    $A922
  1098.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1099.         IMPORT_CFM_FUNCTION BeginUpdate
  1100.     ENDIF
  1101.  
  1102. ;
  1103. ; pascal void EndUpdate(WindowPtr window)
  1104. ;
  1105.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1106.         _EndUpdate:    OPWORD    $A923
  1107.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1108.         IMPORT_CFM_FUNCTION EndUpdate
  1109.     ENDIF
  1110.  
  1111. ;  Routines available in Mac OS 8.5 and later
  1112. ;
  1113. ; pascal OSStatus InvalWindowRgn(WindowPtr window, RgnHandle region)
  1114. ;
  1115.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1116.         IMPORT_CFM_FUNCTION InvalWindowRgn
  1117.     ENDIF
  1118.  
  1119. ;
  1120. ; pascal OSStatus InvalWindowRect(WindowPtr window, const Rect *bounds)
  1121. ;
  1122.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1123.         IMPORT_CFM_FUNCTION InvalWindowRect
  1124.     ENDIF
  1125.  
  1126. ;
  1127. ; pascal OSStatus ValidWindowRgn(WindowPtr window, RgnHandle region)
  1128. ;
  1129.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1130.         IMPORT_CFM_FUNCTION ValidWindowRgn
  1131.     ENDIF
  1132.  
  1133. ;
  1134. ; pascal OSStatus ValidWindowRect(WindowPtr window, const Rect *bounds)
  1135. ;
  1136.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1137.         IMPORT_CFM_FUNCTION ValidWindowRect
  1138.     ENDIF
  1139.  
  1140.  
  1141. ; ——————————————————————————————————————————————————————————————————————————————————————
  1142. ;  • DrawGrowIcon                                                                        
  1143. ;                                                                                         
  1144. ;     DrawGrowIcon is deprecated in Mac OS 8.0 and later.  Theme-savvy window defprocs    
  1145. ;     include the grow box in the window frame automatically.                                
  1146. ; ——————————————————————————————————————————————————————————————————————————————————————
  1147. ;
  1148. ; pascal void DrawGrowIcon(WindowPtr window)
  1149. ;
  1150.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1151.         _DrawGrowIcon:    OPWORD    $A904
  1152.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1153.         IMPORT_CFM_FUNCTION DrawGrowIcon
  1154.     ENDIF
  1155.  
  1156. ; ——————————————————————————————————————————————————————————————————————————————————————
  1157. ;  • Window Titles                                                                        
  1158. ; ——————————————————————————————————————————————————————————————————————————————————————
  1159. ;
  1160. ; pascal void SetWTitle(WindowPtr window, ConstStr255Param title)
  1161. ;
  1162.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1163.         _SetWTitle:    OPWORD    $A91A
  1164.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1165.         IMPORT_CFM_FUNCTION SetWTitle
  1166.     ENDIF
  1167.  
  1168. ;
  1169. ; pascal void GetWTitle(WindowPtr window, Str255 title)
  1170. ;
  1171.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1172.         _GetWTitle:    OPWORD    $A919
  1173.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1174.         IMPORT_CFM_FUNCTION GetWTitle
  1175.     ENDIF
  1176.  
  1177. ; ——————————————————————————————————————————————————————————————————————————————————————
  1178. ;  • Window Proxies (Mac OS 8.5 and later)                                                
  1179. ; ——————————————————————————————————————————————————————————————————————————————————————
  1180. ;
  1181. ; pascal OSStatus SetWindowProxyFSSpec(WindowPtr window, const FSSpec *inFile)
  1182. ;
  1183.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1184.         IMPORT_CFM_FUNCTION SetWindowProxyFSSpec
  1185.     ENDIF
  1186.  
  1187. ;
  1188. ; pascal OSStatus GetWindowProxyFSSpec(WindowPtr window, FSSpec *outFile)
  1189. ;
  1190.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1191.         IMPORT_CFM_FUNCTION GetWindowProxyFSSpec
  1192.     ENDIF
  1193.  
  1194. ;
  1195. ; pascal OSStatus SetWindowProxyAlias(WindowPtr window, AliasHandle alias)
  1196. ;
  1197.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1198.         IMPORT_CFM_FUNCTION SetWindowProxyAlias
  1199.     ENDIF
  1200.  
  1201. ;
  1202. ; pascal OSStatus GetWindowProxyAlias(WindowPtr window, AliasHandle *alias)
  1203. ;
  1204.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1205.         IMPORT_CFM_FUNCTION GetWindowProxyAlias
  1206.     ENDIF
  1207.  
  1208. ;
  1209. ; pascal OSStatus SetWindowProxyCreatorAndType(WindowPtr window, OSType fileCreator, OSType fileType, SInt16 vRefNum)
  1210. ;
  1211.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1212.         IMPORT_CFM_FUNCTION SetWindowProxyCreatorAndType
  1213.     ENDIF
  1214.  
  1215. ;
  1216. ; pascal OSStatus GetWindowProxyIcon(WindowPtr window, IconRef *outIcon)
  1217. ;
  1218.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1219.         IMPORT_CFM_FUNCTION GetWindowProxyIcon
  1220.     ENDIF
  1221.  
  1222. ;
  1223. ; pascal OSStatus SetWindowProxyIcon(WindowPtr window, IconRef icon)
  1224. ;
  1225.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1226.         IMPORT_CFM_FUNCTION SetWindowProxyIcon
  1227.     ENDIF
  1228.  
  1229. ;
  1230. ; pascal OSStatus RemoveWindowProxy(WindowPtr window)
  1231. ;
  1232.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1233.         IMPORT_CFM_FUNCTION RemoveWindowProxy
  1234.     ENDIF
  1235.  
  1236. ;
  1237. ; pascal OSStatus BeginWindowProxyDrag(WindowPtr window, DragReference *outNewDrag, RgnHandle outDragOutlineRgn)
  1238. ;
  1239.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1240.         IMPORT_CFM_FUNCTION BeginWindowProxyDrag
  1241.     ENDIF
  1242.  
  1243. ;
  1244. ; pascal OSStatus EndWindowProxyDrag(WindowPtr window, DragReference theDrag)
  1245. ;
  1246.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1247.         IMPORT_CFM_FUNCTION EndWindowProxyDrag
  1248.     ENDIF
  1249.  
  1250. ;
  1251. ; pascal OSStatus TrackWindowProxyFromExistingDrag(WindowPtr window, Point startPt, DragReference drag, RgnHandle inDragOutlineRgn)
  1252. ;
  1253.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1254.         IMPORT_CFM_FUNCTION TrackWindowProxyFromExistingDrag
  1255.     ENDIF
  1256.  
  1257. ;
  1258. ; pascal OSStatus TrackWindowProxyDrag(WindowPtr window, Point startPt)
  1259. ;
  1260.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1261.         IMPORT_CFM_FUNCTION TrackWindowProxyDrag
  1262.     ENDIF
  1263.  
  1264. ;
  1265. ; pascal Boolean IsWindowModified(WindowPtr window)
  1266. ;
  1267.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1268.         IMPORT_CFM_FUNCTION IsWindowModified
  1269.     ENDIF
  1270.  
  1271. ;
  1272. ; pascal OSStatus SetWindowModified(WindowPtr window, Boolean modified)
  1273. ;
  1274.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1275.         IMPORT_CFM_FUNCTION SetWindowModified
  1276.     ENDIF
  1277.  
  1278. ;
  1279. ; pascal Boolean IsWindowPathSelectClick(WindowPtr window, EventRecord *event)
  1280. ;
  1281.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1282.         IMPORT_CFM_FUNCTION IsWindowPathSelectClick
  1283.     ENDIF
  1284.  
  1285. ;
  1286. ; pascal OSStatus WindowPathSelect(WindowPtr window, MenuHandle menu, SInt32 *outMenuResult)
  1287. ;
  1288.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1289.         IMPORT_CFM_FUNCTION WindowPathSelect
  1290.     ENDIF
  1291.  
  1292.  
  1293. ; ——————————————————————————————————————————————————————————————————————————————————————
  1294. ;     • HiliteWindowFrameForDrag    (Mac OS 8.5 and later)                                    
  1295. ;                                                                                         
  1296. ;     If you call ShowDragHilite and HideDragHilite, you don’t need to use this routine.    
  1297. ;     If you implement custom drag hiliting, you should call HiliteWindowFrameForDrag        
  1298. ;     when the drag is tracking inside a window with drag-hilited content.                
  1299. ; ——————————————————————————————————————————————————————————————————————————————————————
  1300. ;
  1301. ; pascal OSStatus HiliteWindowFrameForDrag(WindowPtr window, Boolean hilited)
  1302. ;
  1303.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1304.         Macro
  1305.         _HiliteWindowFrameForDrag
  1306.             moveq               #25,D0
  1307.             dc.w                $A829
  1308.         EndM
  1309.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1310.         IMPORT_CFM_FUNCTION HiliteWindowFrameForDrag
  1311.     ENDIF
  1312.  
  1313.  
  1314. ; ——————————————————————————————————————————————————————————————————————————————————————
  1315. ;  • Window Transitions    (Mac OS 8.5 and later)                                            
  1316. ;                                                                                          
  1317. ;      TransitionWindow displays a window with accompanying animation and sound.            
  1318. ; ——————————————————————————————————————————————————————————————————————————————————————
  1319. ; typedef UInt32                         WindowTransitionEffect
  1320.  
  1321.  
  1322. kWindowZoomTransitionEffect        EQU        1                    ; Finder-like zoom rectangles, use with Show or Open transition actions
  1323. ; typedef UInt32                         WindowTransitionAction
  1324.  
  1325.  
  1326. kWindowShowTransitionAction        EQU        1                    ; param is rect in global coordinates from which to start the animation
  1327. kWindowHideTransitionAction        EQU        2                    ; param is rect in global coordinates at which to end the animation
  1328. ;
  1329. ; pascal OSStatus TransitionWindow(WindowPtr window, WindowTransitionEffect effect, WindowTransitionAction action, const Rect *rect)
  1330. ;
  1331.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1332.         IMPORT_CFM_FUNCTION TransitionWindow
  1333.     ENDIF
  1334.  
  1335.  
  1336. ; ——————————————————————————————————————————————————————————————————————————————————————
  1337. ;  • Window Positioning                                                                    
  1338. ; ——————————————————————————————————————————————————————————————————————————————————————
  1339.  
  1340. ;
  1341. ; pascal void MoveWindow(WindowPtr window, short hGlobal, short vGlobal, Boolean front)
  1342. ;
  1343.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1344.         _MoveWindow:    OPWORD    $A91B
  1345.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1346.         IMPORT_CFM_FUNCTION MoveWindow
  1347.     ENDIF
  1348.  
  1349. ;
  1350. ; pascal void SizeWindow(WindowPtr window, short w, short h, Boolean fUpdate)
  1351. ;
  1352.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1353.         _SizeWindow:    OPWORD    $A91D
  1354.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1355.         IMPORT_CFM_FUNCTION SizeWindow
  1356.     ENDIF
  1357.  
  1358. ;
  1359. ; pascal long GrowWindow(WindowPtr window, Point startPt, const Rect *bBox)
  1360. ;
  1361.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1362.         _GrowWindow:    OPWORD    $A92B
  1363.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1364.         IMPORT_CFM_FUNCTION GrowWindow
  1365.     ENDIF
  1366.  
  1367. ;
  1368. ; pascal void DragWindow(WindowPtr window, Point startPt, const Rect *boundsRect)
  1369. ;
  1370.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1371.         _DragWindow:    OPWORD    $A925
  1372.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1373.         IMPORT_CFM_FUNCTION DragWindow
  1374.     ENDIF
  1375.  
  1376. ;
  1377. ; pascal void ZoomWindow(WindowPtr window, short partCode, Boolean front)
  1378. ;
  1379.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1380.         _ZoomWindow:    OPWORD    $A83A
  1381.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1382.         IMPORT_CFM_FUNCTION ZoomWindow
  1383.     ENDIF
  1384.  
  1385. ;  Routines available in Mac OS 8.0 (Appearance 1.0) and later
  1386.  
  1387. ;
  1388. ; pascal Boolean IsWindowCollapsable(WindowPtr window)
  1389. ;
  1390.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1391.         Macro
  1392.         _IsWindowCollapsable
  1393.             move.w              #$000F,D0
  1394.             dc.w                $AA74
  1395.         EndM
  1396.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1397.         IMPORT_CFM_FUNCTION IsWindowCollapsable
  1398.     ENDIF
  1399.  
  1400. ;
  1401. ; pascal Boolean IsWindowCollapsed(WindowPtr window)
  1402. ;
  1403.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1404.         Macro
  1405.         _IsWindowCollapsed
  1406.             move.w              #$0010,D0
  1407.             dc.w                $AA74
  1408.         EndM
  1409.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1410.         IMPORT_CFM_FUNCTION IsWindowCollapsed
  1411.     ENDIF
  1412.  
  1413. ;
  1414. ; pascal OSStatus CollapseWindow(WindowPtr window, Boolean collapse)
  1415. ;
  1416.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1417.         Macro
  1418.         _CollapseWindow
  1419.             move.w              #$0011,D0
  1420.             dc.w                $AA74
  1421.         EndM
  1422.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1423.         IMPORT_CFM_FUNCTION CollapseWindow
  1424.     ENDIF
  1425.  
  1426. ;
  1427. ; pascal OSStatus CollapseAllWindows(Boolean collapse)
  1428. ;
  1429.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1430.         Macro
  1431.         _CollapseAllWindows
  1432.             move.w              #$0012,D0
  1433.             dc.w                $AA74
  1434.         EndM
  1435.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1436.         IMPORT_CFM_FUNCTION CollapseAllWindows
  1437.     ENDIF
  1438.  
  1439. ;  Routines available in Mac OS 8.5 and later
  1440.  
  1441. ;
  1442. ; pascal OSStatus RepositionWindow(WindowPtr window, WindowPtr parentWindow, WindowPositionMethod method)
  1443. ;
  1444.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1445.         IMPORT_CFM_FUNCTION RepositionWindow
  1446.     ENDIF
  1447.  
  1448. ;
  1449. ; pascal OSStatus SetWindowBounds(WindowPtr window, WindowRegionCode regionCode, const Rect *globalBounds)
  1450. ;
  1451.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1452.         IMPORT_CFM_FUNCTION SetWindowBounds
  1453.     ENDIF
  1454.  
  1455. ;
  1456. ; pascal OSStatus GetWindowBounds(WindowPtr window, WindowRegionCode regionCode, Rect *globalBounds)
  1457. ;
  1458.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1459.         IMPORT_CFM_FUNCTION GetWindowBounds
  1460.     ENDIF
  1461.  
  1462. ;
  1463. ; pascal OSStatus MoveWindowStructure(WindowPtr window, short hGlobal, short vGlobal)
  1464. ;
  1465.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1466.         IMPORT_CFM_FUNCTION MoveWindowStructure
  1467.     ENDIF
  1468.  
  1469. ;
  1470. ; pascal Boolean ResizeWindow(WindowPtr window, Point startPoint, const Rect *sizeConstraints, Rect *newContentRect)
  1471. ;
  1472.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1473.         IMPORT_CFM_FUNCTION ResizeWindow
  1474.     ENDIF
  1475.  
  1476. ;
  1477. ; pascal Boolean IsWindowInStandardState(WindowPtr window, Point *idealSize, Rect *idealStandardState)
  1478. ;
  1479.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1480.         IMPORT_CFM_FUNCTION IsWindowInStandardState
  1481.     ENDIF
  1482.  
  1483. ;
  1484. ; pascal OSStatus ZoomWindowIdeal(WindowPtr window, SInt16 partCode, Point *ioIdealSize)
  1485. ;
  1486.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1487.         IMPORT_CFM_FUNCTION ZoomWindowIdeal
  1488.     ENDIF
  1489.  
  1490. ;
  1491. ; pascal OSStatus GetWindowIdealUserState(WindowPtr window, Rect *userState)
  1492. ;
  1493.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1494.         IMPORT_CFM_FUNCTION GetWindowIdealUserState
  1495.     ENDIF
  1496.  
  1497. ;
  1498. ; pascal OSStatus SetWindowIdealUserState(WindowPtr window, Rect *userState)
  1499. ;
  1500.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1501.         IMPORT_CFM_FUNCTION SetWindowIdealUserState
  1502.     ENDIF
  1503.  
  1504.  
  1505. ; ——————————————————————————————————————————————————————————————————————————————————————
  1506. ;  • Window Visibility                                                                    
  1507. ; ——————————————————————————————————————————————————————————————————————————————————————
  1508.  
  1509. ;
  1510. ; pascal void HideWindow(WindowPtr window)
  1511. ;
  1512.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1513.         _HideWindow:    OPWORD    $A916
  1514.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1515.         IMPORT_CFM_FUNCTION HideWindow
  1516.     ENDIF
  1517.  
  1518. ;
  1519. ; pascal void ShowWindow(WindowPtr window)
  1520. ;
  1521.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1522.         _ShowWindow:    OPWORD    $A915
  1523.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1524.         IMPORT_CFM_FUNCTION ShowWindow
  1525.     ENDIF
  1526.  
  1527. ;
  1528. ; pascal void ShowHide(WindowPtr window, Boolean showFlag)
  1529. ;
  1530.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1531.         _ShowHide:    OPWORD    $A908
  1532.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1533.         IMPORT_CFM_FUNCTION ShowHide
  1534.     ENDIF
  1535.  
  1536.  
  1537. ; ——————————————————————————————————————————————————————————————————————————————————————
  1538. ;  • Window Properties (Mac OS 8.5 and later)                                            
  1539. ; ——————————————————————————————————————————————————————————————————————————————————————
  1540.  
  1541. ;
  1542. ; pascal OSStatus GetWindowProperty(WindowPtr window, PropertyCreator propertyCreator, PropertyTag propertyTag, UInt32 bufferSize, UInt32 *actualSize, void *propertyBuffer)
  1543. ;
  1544.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1545.         IMPORT_CFM_FUNCTION GetWindowProperty
  1546.     ENDIF
  1547.  
  1548. ;
  1549. ; pascal OSStatus GetWindowPropertySize(WindowPtr window, PropertyCreator creator, PropertyTag tag, UInt32 *size)
  1550. ;
  1551.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1552.         IMPORT_CFM_FUNCTION GetWindowPropertySize
  1553.     ENDIF
  1554.  
  1555. ;
  1556. ; pascal OSStatus SetWindowProperty(WindowPtr window, PropertyCreator propertyCreator, PropertyTag propertyTag, UInt32 propertySize, void *propertyBuffer)
  1557. ;
  1558.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1559.         IMPORT_CFM_FUNCTION SetWindowProperty
  1560.     ENDIF
  1561.  
  1562. ;
  1563. ; pascal OSStatus RemoveWindowProperty(WindowPtr window, PropertyCreator propertyCreator, PropertyTag propertyTag)
  1564. ;
  1565.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1566.         IMPORT_CFM_FUNCTION RemoveWindowProperty
  1567.     ENDIF
  1568.  
  1569. ; ——————————————————————————————————————————————————————————————————————————————————————
  1570. ;  • Utilities                                                                            
  1571. ; ——————————————————————————————————————————————————————————————————————————————————————
  1572. ;
  1573. ; pascal long PinRect(const Rect *theRect, Point thePt)
  1574. ;
  1575.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1576.         _PinRect:    OPWORD    $A94E
  1577.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1578.         IMPORT_CFM_FUNCTION PinRect
  1579.     ENDIF
  1580.  
  1581.  
  1582. ;
  1583. ; pascal RgnHandle GetGrayRgn(void)
  1584. ;
  1585.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1586.         Macro
  1587.         _GetGrayRgn           &dest=(sp)
  1588.             move.l            $09EE,&dest
  1589.         EndM
  1590.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1591.         IMPORT_CFM_FUNCTION GetGrayRgn
  1592.     ENDIF
  1593.  
  1594.  
  1595. ; ——————————————————————————————————————————————————————————————————————————————————————
  1596. ;  • Window Part Tracking                                                                
  1597. ; ——————————————————————————————————————————————————————————————————————————————————————
  1598. ;
  1599. ; pascal Boolean TrackBox(WindowPtr window, Point thePt, short partCode)
  1600. ;
  1601.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1602.         _TrackBox:    OPWORD    $A83B
  1603.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1604.         IMPORT_CFM_FUNCTION TrackBox
  1605.     ENDIF
  1606.  
  1607. ;
  1608. ; pascal Boolean TrackGoAway(WindowPtr window, Point thePt)
  1609. ;
  1610.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1611.         _TrackGoAway:    OPWORD    $A91E
  1612.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1613.         IMPORT_CFM_FUNCTION TrackGoAway
  1614.     ENDIF
  1615.  
  1616.  
  1617. ; ——————————————————————————————————————————————————————————————————————————————————————
  1618. ;  • Region Dragging                                                                    
  1619. ; ——————————————————————————————————————————————————————————————————————————————————————
  1620. ;
  1621. ; pascal long DragGrayRgn(RgnHandle theRgn, Point startPt, const Rect *limitRect, const Rect *slopRect, short axis, DragGrayRgnUPP actionProc)
  1622. ;
  1623.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1624.         _DragGrayRgn:    OPWORD    $A905
  1625.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1626.         IMPORT_CFM_FUNCTION DragGrayRgn
  1627.     ENDIF
  1628.  
  1629. ;
  1630. ; pascal long DragTheRgn(RgnHandle theRgn, Point startPt, const Rect *limitRect, const Rect *slopRect, short axis, DragGrayRgnUPP actionProc)
  1631. ;
  1632.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1633.         _DragTheRgn:    OPWORD    $A926
  1634.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1635.         IMPORT_CFM_FUNCTION DragTheRgn
  1636.     ENDIF
  1637.  
  1638.  
  1639. ; ——————————————————————————————————————————————————————————————————————————————————————
  1640. ;     • GetAuxWin                                                                            
  1641. ;                                                                                         
  1642. ;     Avoid using GetAuxWin if at all possible                                            
  1643. ; ——————————————————————————————————————————————————————————————————————————————————————
  1644. ;
  1645. ; pascal Boolean GetAuxWin(WindowPtr window, AuxWinHandle *awHndl)
  1646. ;
  1647.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1648.         _GetAuxWin:    OPWORD    $AA42
  1649.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1650.         IMPORT_CFM_FUNCTION GetAuxWin
  1651.     ENDIF
  1652.  
  1653. ; ——————————————————————————————————————————————————————————————————————————————————————
  1654. ;  • MixedMode & ProcPtrs                                                                
  1655. ; ——————————————————————————————————————————————————————————————————————————————————————
  1656. ; ——————————————————————————————————————————————————————————————————————————————————————
  1657. ;  • C Glue                                                                                
  1658. ; ——————————————————————————————————————————————————————————————————————————————————————
  1659. ; ——————————————————————————————————————————————————————————————————————————————————————
  1660. ;  • WindowRecord accessor macros                                                        
  1661. ; ——————————————————————————————————————————————————————————————————————————————————————
  1662. ;    *****************************************************************************
  1663. ;    *                                                                           *
  1664. ;    * The conditional STRICT_WINDOWS has been removed from this interface file. *
  1665. ;    * The accessor macros to a WindowRecord are no longer necessary.            *
  1666. ;    *                                                                           *
  1667. ;    * All ≈Ref Types have reverted to their original Handle and Ptr Types.      *
  1668. ;    *                                                                           *
  1669. ;    *****************************************************************************
  1670. ;
  1671. ;    Details:
  1672. ;    The original purpose of the STRICT_ conditionals and accessor macros was to
  1673. ;    help ease the transition to Copland.  Shared data structures are difficult
  1674. ;    to coordinate in a preemptive multitasking OS.  By hiding the fields in a
  1675. ;    WindowRecord and other data structures, we would begin the migration to the
  1676. ;    discipline wherein system data structures are completely hidden from
  1677. ;    applications.
  1678. ;    
  1679. ;    After many design reviews, we finally concluded that with this sort of
  1680. ;    migration, the system could never tell when an application was no longer
  1681. ;    peeking at a WindowRecord, and thus the data structure might never become
  1682. ;    system owned.  Additionally, there were many other limitations in the
  1683. ;    classic toolbox that were begging to be addressed.  The final decision was
  1684. ;    to leave the traditional toolbox as a compatibility mode.
  1685. ;    
  1686. ;    We also decided to use the Handle and Ptr based types in the function
  1687. ;    declarations.  For example, NewWindow now returns a WindowPtr rather than a
  1688. ;    WindowRef.  The Ref types are still defined in the header files, so all
  1689. ;    existing code will still compile exactly as it did before.  There are
  1690. ;    several reasons why we chose to do this:
  1691. ;    
  1692. ;    - The importance of backwards compatibility makes it unfeasible for us to
  1693. ;    enforce real opaque references in the implementation anytime in the
  1694. ;    foreseeable future.  Therefore, any opaque data types (e.g. WindowRef,
  1695. ;    ControlRef, etc.) in the documentation and header files would always be a
  1696. ;    fake veneer of opacity.
  1697. ;    
  1698. ;    - There exists a significant base of books and sample code that neophyte
  1699. ;    Macintosh developers use to learn how to program the Macintosh.  These
  1700. ;    books and sample code all use direct data access.  Introducing opaque data
  1701. ;    types at this point would confuse neophyte programmers more than it would
  1702. ;    help them.
  1703. ;    
  1704. ;    - Direct data structure access is used by nearly all Macintosh developers. 
  1705. ;    Changing the interfaces to reflect a false opacity would not provide any
  1706. ;    benefit to these developers.
  1707. ;    
  1708. ;    - Accessor functions are useful in and of themselves as convenience
  1709. ;    functions.
  1710. ;    
  1711. ;    - Note: some accessor names conflict with API's in Win32 and have been renamed
  1712. ;    to have a Mac prefix (QuickTime 3.0).
  1713. ;
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.     ENDIF ; __MACWINDOWS__ 
  1725.  
  1726.